import http from "@/server/http";

// 收取记录
export const queryCollectList = (params) => {
    return http({
        url: "/user/tree/log/collect_list",
        method: "POST",
        data: params,
    })
}

//点赞 
export const toCollectLike = (params) => {
    return http({
        url: "/user/tree/collect/like",
        method: "POST",
        data: params,
    })
}

//随机抓取 
export const randomGrab = (params) => {
    return http({
        url: "/user/tree/collect/index",
        method: "POST",
        data: params,
    })
}

//投递列表 
export const queryDeliveryList = (params) => {
    return http({
        url: "/user/tree/log/send_list",
        method: "POST",
        data: params,
    })
}

//投递详情 
export const queryDeliveryDatails = (params) => {
    return http({
        url: "/user/tree/log/fruit_info",
        method: "POST",
        data: params,
    })
}


//详情 
export const checkWisdomFruitDet = (params) => {
    return http({
        url: "/admin/tree/config_fruit/info",
        method: "POST",
        data: params,
    })
}

//评论
export const collectComment = (params) => {
    return http({
        url: "/admin/tree/collect/comment",
        method: "POST",
        data: params,
    })
}

//投递
export const deliverFruit = (params) => {
    return http({
        url: "/admin/tree/config_fruit/add",
        method: "POST",
        data: params,
    })
}

//投递列表
export const queryDeliverInfo = (params) => {
    return http({
        url: "/admin/tree/config_fruit/index",
        method: "POST",
        data: params,
    })
}

//上传mp3 
export const uploadMp3 = (params) => {
    const formData = new FormData();
    formData.append('file', params.file);
    return http({
        url: "/common/upload/mp3",
        method: "POST",
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

//获取分片上传id 
export const getUploadId = (params) => {
    return http({
        url: "/common/upload/getUploadId",
        method: "POST",
        data: params,
    })
}

//上传分片 
export const getUploadChunk = (params) => {
    return http({
        url: "/common/upload/chunk",
        method: "POST",
        data: params,
    })
}

//查询收发设置 
export const queryTreeConfig = (params) => {
    return http({
        url: "/admin/tree/config_info/index",
        method: "POST",
        data: params,
    })
}

//保存收发信息 
export const saveTreeConfig = (params) => {
    return http({
        url: "/admin/tree/config_info/update",
        method: "POST",
        data: params,
    })
}

//查看收取详情 
export const queryCollectDetails = (params) => {
    return http({
        url: "/admin/tree/log/info",
        method: "POST",
        data: params,
    })
}

//删除收取记录 
export const delCollectInfo = (params) => {
    return http({
        url: "/admin/tree/log/del",
        method: "POST",
        data: params,
    })
}

//是否开启评论 
export const operationComment = (params) => {
    return http({
        url: "/admin/tree/config_fruit/comment_status",
        method: "POST",
        data: params,
    })
}

//投递删除 
export const delDeliverInfo = (params) => {
    return http({
        url: "/admin/tree/config_fruit/del",
        method: "POST",
        data: params,
    })
}